#include "CmdLine.h"
#include "Arduino.h"
CmdLine::CmdLine()
{

}
CmdLine::~CmdLine()
{

}

void CmdLine::append(char c)
{
    if(_index>=sizeof(_buf)){
        _index = 0;
    }
    _buf[_index++] = c;
}
void CmdLine::update()
{
    _update_flag = true;
}
void CmdLine::schedule()
{
    if(!_update_flag){
        return;
    }
    for(uint8_t i=0;i<_index;i++){
        Serial.print(_buf[i]);
    }
    _update_flag = false;
}
void CmdLine::cleanup()
{
    _update_flag = false;
    _index = 0;
}